Recording apparatus and method, playback apparatus and method, and recording medium therefor

ABSTRACT

Audio signals and video signals are recorded as follows. Three video PES packets, each being formed of one video frame, are combined to form a video editing unit. Then, the video editing unit and the associated audio editing unit are alternately disposed on a magnetic tape. The recorded PES packets are output as a TS as follows. A STC is initialized, and then, PSI packets of a PAT and a PMT are output. TS packets specially used for a PCR for storing the STC are then output at certain intervals. Subsequently, video PES packets are converted into TSs, and the output of the video TSs is started while synchronizing a time obtained by subtracting vbv_delay from the first I-picture DTS with the STC. Audio PES packets are converted into TSs, and the output of the audio TSs is started while synchronizing a time obtained by subtracting the start up delay from the first frame with the STC. Data streams are recorded in the following manner. The three MSBs of a sync block (SB) header indicate the type of data to be recorded in the following data area. If the data type is PES-VIDEO or PES-AUDIO, a full/partial flag is recorded in the fourth MSB of the SB header. In the subsequent four LSBs, the continuity count value representing the continuity of the same type of SBs is recorded.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to recording apparatuses and methods,playback apparatuses and methods, and to recording media therefor. Moreparticularly, the invention relates to a recording apparatus and methodsuitable for, for example, compressing audiovisual (AV) signals andrecording them on information recording media, and to a recording mediumtherefor. The invention also pertains to a playback apparatus and methodsuitable for, for example, converting AV signals recorded on informationrecording media as packetized elementary stream packets into transportstreams and outputting them, and to a recording medium therefor. Theinvention also relates to a recording apparatus and method and aplayback apparatus and method suitable for, for example, recording andreading different types of data streams on and from informationrecording media, and to a recording medium therefor.

2. Description of the Related Art

As the DV format used for consumer video cassette recorders (VCRs), asystem is provided for coding video signals by performing intra-framecompression and coding the corresponding audio signals withoutcompressing them or coding the audio signals so that they can beinstantaneously companded, and then for recording the encoded videosignals and audio signals on magnetic tape.

Video signals and audio signals encoded in the DV format and recorded onrecording media are suitable for editing the corresponding images andsound so that they can be spliced at a certain position.

However, because of a low compression rate of the DV format, a systemhaving a high transfer rate and a medium having a large storage capacityare required, and also, the recording time becomes shorter if thecapacity of an information recording medium is limited.

To overcome the above-described drawbacks, a system for compressingvideo signals and audio signals according to an Moving Picture ExpertsGroup (MPEG) method and for recording them in the form of transportstream (hereinafter sometimes referred to as “TS”) has been proposed andis used.

According to the system using the MPEG method, video signals are encodedby compressing a long group of pictures (GOP) formed of a plurality offrames according to the inter-frame compression method, while audiosignals are encoded by compressing a plurality of samples according tothe frame compression method, thereby achieving a high compression rate.Accordingly, the provision of a recording system having a high transferrate becomes unnecessary, space can be saved on the recording medium,and the recording time becomes longer compared to a DV-format systemeven if the capacity of the recording medium is limited.

However, in a system in which MPEG-compressed video signals and audiosignals are recorded in the form of TS, the following problems arepresented.

That is, as stated above, video signals are MPEG-compressed in units oflong GOPs, the length of one frame of an image varies according to thetype of image (Intra (I) picture, Predictive (P) picture, andBidirectionally predictive (B) picture) or the design of the image. Inother words, the video signals are not compressed at a constant rate. Incontrast, audio signals are compressed at a fixed rate. Accordingly,even if the video signals and the corresponding audio signals aresimultaneously encoded, the packets of the video signals and thecorresponding packets of the audio signals may disadvantageously beseparately disposed on a TS.

In this case, if images and sound are edited so that they are spliced ata certain position on a TS, there may be temporal displacement in thecontinuity between video frames and audio frames, or one of the videoframes or the audio frames may be missing.

It is also necessary to add to a TS a TS header, a time stamp indicatingthe arrival time of video signals and audio signals at a decoder, and aprogram clock reference (PCR) packet for storing a PCR, which is thereference time for a decoding operation. Accordingly, the overheadbecomes larger, and the recording rate is lowered.

In addition, it is difficult to perform so-called “jog playback”, suchas pause, slow, and reverse playback, on video signals and audiosignals. To enable the jog playback operation, it is necessary toconvert TSs to elementary streams.

Moreover, an error may occur in a video signal or an audio signal in theform of a TS during a reading or playback operation, thereby adverselyinfluencing the image quality or the sound quality.

SUMMARY OF THE INVENTION

Accordingly, in view of the above background, it is an object of thepresent invention to avoid any inconvenience caused by recordingMPEG-compressed video signals and audio signals on an informationrecording medium as packetized elementary streams when video and audioediting is performed.

It is another object of the present invention to record MPEG-compressedvideo signals and audio signals as packetized elementary streams and tooutput them as TSs.

It is still another object of the present invention to correctly detectan error occurring during a recording or playback operation.

In order to achieve the above-described objects, according to one aspectof the present invention, there is provided a recording apparatus forrecording an audio signal and a video signal on an information recordingmedium. The recording apparatus includes a video packetized elementarystream packet generator for generating video packetized elementarystream packets by dividing a video elementary stream in which a videosignal is compressed and coded according to a predetermined method by apredetermined number of video frames and by adding a header. An audiopacketized elementary stream packet generator generates audio packetizedelementary stream packets by dividing an audio elementary stream inwhich an audio signal is compressed and coded according to apredetermined method by a predetermined number of audio frames and byadding a header. A video packetized elementary stream packet unitgenerator generates a video packetized elementary stream packet unit bycombining a predetermined number of the video packetized elementarystream packets. An audio packetized elementary stream packet unitgenerator generates an audio packetized elementary stream packet unit bycombining the audio packetized elementary stream packets correspondingto the video packetized elementary stream packet unit. A sync blockgenerator generates sync blocks by alternately disposing the videopacketized elementary stream packet unit and the audio packetizedelementary stream packet unit and by converting the video packetizedelementary stream packet unit and the audio packetized elementary streampacket unit into a predetermined recording format. A recording unitrecords the sync blocks on the information recording medium.

The video packetized elementary stream packet generator may generate thevideo packetized elementary stream packets by dividing the videoelementary stream by one video frame, and by adding the header in whichat least one of a presentation time stamp and a decoding time stamp isrecorded.

The audio packetized elementary stream packet generator may generatesthe audio packetized elementary stream packets by dividing the audioelementary stream by one audio frame, and by adding the header in whichat least a presentation time stamp is recorded.

The audio packetized elementary stream packet unit generator maygenerate the audio packetized elementary stream packet unit by combiningthe audio packetized elementary stream packets having a presentationtime stamp which is after the earliest value of the presentation timestamps recorded in the headers of the video packetized elementary streampackets forming the current video packetized elementary stream packetunit and which is before the earliest value of the presentation timestamps recorded in the headers of the video packetized elementary streampackets forming the subsequent video packetized elementary stream packetunit.

The aforementioned recording apparatus may further include a separationunit for separating a transport stream in which the compressed and codedvideo signal and the compressed and coded audio signal are multiplexedinto the video elementary stream and the audio elementary stream.

The sync block generator may generate the sync block whose data type isAUX by using transport stream packets of program specific informationincluded in the transport stream.

The sync block generator may generate the sync block by recording IDinformation indicating the data type of the sync block in the header ofthe sync block.

The sync block generator may record a flag indicating whether the dataarea of the sync block is totally occupied with effective data in theheader of the sync block, and, when the data area of the sync block isnot totally occupied with the effective data, the data length of theeffective data may be recorded in the head of the data area.

According to another aspect of the present invention, there is provideda recording method for use in a recording apparatus which records anaudio signal and a video signal on an information recording medium. Therecording method includes: a video packetized elementary stream packetgenerating step of generating video packetized elementary stream packetsby dividing a video elementary stream in which a video signal iscompressed and coded according to a predetermined method by apredetermined number of video frames and by adding a header; an audiopacketized elementary stream packet generating step of generating audiopacketized elementary stream packets by dividing an audio elementarystream in which an audio signal is compressed and coded according to apredetermined method by a predetermined number of audio frames and byadding a header; a video packetized elementary stream packet unitgenerating step of generating a video packetized elementary streampacket unit by combining a predetermined number of the video packetizedelementary stream packets; an audio packetized elementary stream packetunit generating step of generating an audio packetized elementary streampacket unit by combining the audio packetized elementary stream packetscorresponding to the video packetized elementary stream packet unit; async block generating step of generating sync blocks by alternatelydisposing the video packetized elementary stream packet unit and theaudio packetized elementary stream packet unit and by converting thevideo packetized elementary stream packet unit and the audio packetizedelementary stream packet unit into a predetermined recording format; anda recording step of recording the sync blocks on the informationrecording medium.

According to still another aspect of the present invention, there isprovided a recording medium for storing a computer-readable program usedfor recording an audio signal and a video signal on an informationrecording medium. The computer-readable program includes: a videopacketized elementary stream packet generating step of generating videopacketized elementary stream packets by dividing a video elementarystream in which a video signal is compressed and coded according to apredetermined method by a predetermined number of video frames and byadding a header; an audio packetized elementary stream packet generatingstep of generating audio packetized elementary stream packets bydividing an audio elementary stream in which an audio signal iscompressed and coded according to a predetermined method by apredetermined number of audio frames and by adding a header; a videopacketized elementary stream packet unit generating step of generating avideo packetized elementary stream packet unit by combining apredetermined number of the video packetized elementary stream packets;an audio packetized elementary stream packet unit generating step ofgenerating an audio packetized elementary stream packet unit bycombining the audio packetized elementary stream packets correspondingto the video packetized elementary stream packet unit; a sync blockgenerating step of generating sync blocks by alternately disposing thevideo packetized elementary stream packet unit and the audio packetizedelementary stream packet unit and by converting the video packetizedelementary stream packet unit and the audio packetized elementary streampacket unit into a predetermined recording format; and a recording stepof recording the sync blocks on the information recording medium.

According to a further aspect of the present invention, there isprovided a recording apparatus for recording an audio signal and a videosignal on an information recording medium. The recording apparatusincludes a video editing unit generator for generating a video editingunit by dividing a video elementary stream in which a video signal iscompressed and coded according to a predetermined method by apredetermined number of video frames. An audio editing unit generatorgenerates an audio editing unit by dividing an audio elementary streamin which an audio signal is compressed and coded according to apredetermined method by a predetermined number of audio frames. A timestamp addition unit adds a time stamp indicating a playback timing toeach of the video editing unit and the audio editing unit. A sync blockgenerator generates sync blocks by alternately disposing the videoediting unit with the time stamp and the audio editing unit with thetime stamp and by converting the video editing unit and the audioediting unit into a predetermined recording format. A recording unitrecords the sync blocks on the information recording medium.

According to a yet further aspect of the present invention, there isprovided a recording method for use in a recording apparatus whichrecords an audio signal and a video signal on an information recordingmedium. The recording method includes: a video editing unit generatingstep of generating a video editing unit by dividing a video elementarystream in which a video signal is compressed and coded according to apredetermined method by a predetermined number of video frames; an audioediting unit generating step of generating an audio editing unit bydividing an audio elementary stream in which an audio signal iscompressed and coded according to a predetermined method by apredetermined number of audio frames; a time stamp addition step ofadding a time stamp indicating a playback timing to each of the videoediting unit and the audio editing unit; a sync block generating step ofgenerating sync blocks by alternately disposing the video editing unitwith the time stamp and the audio editing unit with the time stamp andby converting the video editing unit and the audio editing unit into apredetermined recording format; and a recording step of recording thesync blocks on the information recording medium.

According to a further aspect of the present invention, there isprovided a recording medium for storing a computer-readable program usedfor recording an audio signal and a video signal on an informationrecording medium. The computer-readable program includes: a videoediting unit generating step of generating a video editing unit bydividing a video elementary stream in which a video signal is compressedand coded according to a predetermined method by a predetermined numberof video frames; an audio editing unit generating step of generating anaudio editing unit by dividing an audio elementary stream in which anaudio signal is compressed and coded according to a predetermined methodby a predetermined number of audio frames; a time stamp addition step ofadding a time stamp indicating a playback timing to each of the videoediting unit and the audio editing unit; a sync block generating step ofgenerating sync blocks by alternately disposing the video editing unitwith the time stamp and the audio editing unit with the time stamp andby converting the video editing unit and the audio editing unit into apredetermined recording format; and a recording step of recording thesync blocks on the information recording medium.

According to a further aspect of the present invention, there isprovided a playback apparatus for converting an audio signal and a videosignal recorded on an information recording medium as packetizedelementary stream packets into a transport stream. The playbackapparatus includes a reading unit for reading the packetized elementarystream packets from the information recording medium. An initializingunit initializes a system time clock by using one of a decoding timestamp and a presentation time stamp included in a header of each of thepacketized elementary stream packets. A first generator generates aprogram clock reference packet by using a value of the system time clockwhich is read at predetermined intervals. A conversion unit converts thepacketized elementary stream packets into transport stream packets whilesynchronizing a time obtained by delaying the system time clock by apredetermined period with a time indicating the decoding time stamp orthe presentation time stamp included in the header of each of thepacketized elementary stream packets.

The initializing unit may initialize the system time clock by using avalue obtained by subtracting a predetermined period from the decodingtime stamp or the presentation time stamp included in the header of thepacketized elementary stream packet to be first read. The firstgenerator may start generating the program clock reference packetearlier by a predetermined period than a time at which the packetizedelementary stream packet to be first read is converted into thetransport stream packet by the conversion unit.

The aforementioned playback apparatus may further include a secondgenerator for generating a program association table packet and aprogram map table packet. The second generator may start generating theprogram association table packet and the program map table packetearlier by a predetermined period than a time at which the firstgenerator starts generating the program clock reference packet.

The conversion unit may convert the packetized elementary stream packetsof the video signal into the transport stream packets whilesynchronizing a time obtained by delaying the system time clock byvbv_delay included in a picture header with the time indicating thedecoding time stamp or the presentation time stamp included in theheader of each of the packetized elementary stream packets.

The conversion unit may convert the packetized elementary stream packetsof the video signal into the transport stream packets at a fixed rate,and may intermittently output the transport stream packets.

The conversion unit may convert the packetized elementary stream packetsof the video signal into the transport stream packets at a variablerate, and may output the transports stream packets at regular intervals.

The conversion unit may convert the packetized elementary stream packetsof the audio signal into the transport stream packets whilesynchronizing a time obtained by delaying the system time clock by apredetermined period with a time indicating the presentation time stampincluded in the header of each of the packetized elementary streampackets of the audio signal.

According to a further aspect of the present invention, there isprovided a playback method for use in a playback apparatus whichconverts an audio signal and a video signal recorded on an informationrecording medium as packetized elementary stream packets into atransport stream. The playback method includes: a reading step ofreading the packetized elementary stream packets from the informationrecording medium; an initializing step of initializing a system timeclock by using one of a decoding time stamp and a presentation timestamp included in a header of each of the packetized elementary streampackets; a first generation step of generating a program clock referencepacket by using a value of the system time clock which is read atpredetermined intervals; and a conversion step of converting thepacketized elementary stream packets into transport stream packets whilesynchronizing a time obtained by delaying the system time clock by apredetermined period with a time indicating the decoding time stamp orthe presentation time stamp included in the header of each of thepacketized elementary stream packets.

According to a further aspect of the present invention, there isprovided a recording medium for storing a computer-readable program usedfor converting an audio signal and a video signal recorded on aninformation recording medium as packetized elementary stream packetsinto a transport stream. The computer-readable program includes: areading step of reading the packetized elementary stream packets fromthe information recording medium; an initializing step of initializing asystem time clock by using one of a decoding time stamp and apresentation time stamp included in a header of each of the packetizedelementary stream packets; a first generation step of generating aprogram clock reference packet by using a value of the system time clockwhich is read at predetermined intervals; and a conversion step ofconverting the packetized elementary stream packets into transportstream packets while synchronizing a time obtained by delaying thesystem time clock by a predetermined period with a time indicating thedecoding time stamp or the presentation time stamp included in theheader of each of the packetized elementary stream packets.

According to a further aspect of the present invention, there isprovided a recording apparatus for recording a plurality of data streamson an information recording medium. The recording apparatus includes adividing unit for generating sync blocks by dividing each of the datastreams, which consists of packets, according to a predetermined datalength. A providing unit provides ID information indicating the type ofeach of the data streams and a count value for identifying the order ofthe identical type of data streams to each of the sync blocks. Arecording unit mixes the sync blocks generated from the different typesof data streams and records the sync blocks on the information recordingmedium.

The providing unit may provide a discontinuous count value to the syncblock in case of the occurrence of an error in the corresponding datastream.

The dividing unit may generate the sync blocks by dividing a transportstream packet into a first part and a second part. The providing unitmay provide the count value to one of the sync block generated from thefirst part of the transport stream packet and the sync block generatedfrom the second part of the stream packet.

According to a further aspect of the present invention, there isprovided a recording method for use in a recording apparatus whichrecords a plurality data streams on an information recording medium. Therecording method includes: a dividing step of generating sync blocks bydividing each of the data streams, which consists of packets, accordingto a predetermined data length; a providing step of providingidentification information indicating the type of each of the datastreams and a count value for identifying the order of the identicaltype of data streams to each of the sync blocks; and a recording step ofmixing the sync blocks generated from the different types of datastreams and recording the sync blocks on the information recordingmedium.

According to a further aspect of the present invention, there isprovided a recording medium for storing a computer-readable program usedfor recording a plurality of data streams on an information recordingmedium. The computer-readable program includes: a dividing step ofgenerating sync blocks by dividing each of the data streams, whichconsists of packets, according to a predetermined data length; aproviding step of providing identification information indicating thetype of each of the data streams and a count value for identifying theorder of the identical type of data streams to each of the sync blocks;and a recording step of mixing the sync blocks generated from thedifferent types of data streams and recording the sync blocks on theinformation recording medium.

According to a further aspect of the present invention, there isprovided a playback apparatus for playing back data streams recorded onan information recording medium. The playback apparatus includes areading unit for reading sync blocks from the information recordingmedium. An extraction unit extracts ID information indicating the typeof each of the data streams and a count value for identifying the orderof the identical type of data streams from the sync blocks read by thereading unit. A playback unit plays back the data streams by using thesync blocks read by the reading unit based on the ID information and thecount value extracted by the extraction unit. An insertion unit detectsthe occurrence of an error based on the count value extracted by theextraction unit and inserts error information into the data streamplayed back by the playback unit.

According to a further aspect of the present invention, there isprovided a playback method for use in a playback apparatus which playingback data streams recorded on an information recording medium. Theplayback method includes: a reading step of reading sync blocks from theinformation recording medium; an extraction step of extracting IDinformation indicating the type of each of the data streams and a countvalue for identifying the order of the identical type of data streamsfrom the sync blocks read in the reading step; a playback step ofplaying back the data streams by using the sync blocks read in thereading step based on the ID information and the count value extractedin the extraction step; and an insertion step of detecting theoccurrence of an error based on the count value extracted in theextraction step and inserting error information into the data streamplayed back in the playback step.

According to a further aspect of the present invention, there isprovided a recording medium for storing a computer-readable program usedfor playing back data streams recorded on an information recordingmedium. The computer-readable program includes: a reading step ofreading sync blocks from the information recording medium; an extractionstep of extracting ID information indicating the type of each of thedata streams and a count value for identifying the order of theidentical type of data streams from the sync blocks read in the readingstep; a playback step of playing back the data streams by using the syncblocks read in the reading step based on the ID information and thecount value extracted in the extraction step; and an insertion step ofdetecting the occurrence of an error based on the count value extractedin the extraction step and inserting error information into the datastream played back in the playback step.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating the configuration of an AVrecording/playback apparatus according to the present invention;

FIG. 2 illustrates the ES recording method;

FIG. 3 illustrates the PES recording method;

FIG. 4 illustrates the data structure of a TS packet;

FIG. 5 illustrates the data structure of a PES packet;

FIG. 6 illustrates SBs in one track;

FIG. 7 illustrates the SB header;

FIG. 8 illustrates the data structure of SBs whose data type isPES-VIDEO or PES-AUDIO;

FIG. 9 illustrates the data structure of SBs whose data type is AUX;

FIG. 10 illustrates the data structure of SBs whose data is TS-1 orTS-2;

FIG. 11 illustrates the concept of first recording processing;

FIG. 12 illustrates the concept of second recording processing;

FIG. 13 illustrates the concept of third recording processing;

FIG. 14 illustrates the concept of fourth recording processing;

FIG. 15 is a flow chart illustrating the first recording processing;

FIG. 16 is a flow chart illustrating the second recording processing;

FIG. 17 illustrates a delay period created in the second recordingprocessing;

FIG. 18 is a flow chart illustrating the third recording processing;

FIG. 19 is a flow chart illustrating the fourth recording processing;

FIG. 20 is a flow chart illustrating the TS output processing;

FIG. 21 illustrates a delay period created in the TS output processing;

FIG. 22 illustrates the TS output processing;

FIG. 23 illustrates error handling performed during PES recording; and

FIG. 24 illustrates error handling performed during TS recording.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

An AV recording/playback apparatus is described in detail below throughillustration of an embodiment of the present invention. The AVrecording/playback apparatus converts input video and audio basebandsignals into packetized elementary streams (hereinafter referred to as a“PESs”) and records them on a magnetic tape. The AV recording/playbackapparatus also converts input TSs into PESs and records them on themagnetic tape, or directly records input TSs on the magnetic tapewithout converting them into PESs. The AV recording/playback apparatusreads PESs recorded on the magnetic tape, and converts PESs recorded onthe magnetic tape into TSs and outputs them.

FIG. 1 illustrates an example of the configuration of an AVrecording/playback apparatus. A video encoder 1 encodes an input videobaseband signal according to the MPEG method so as to generate a videoelementary stream (hereinafter referred to as an “ES”), and outputs thevideo ES to a video PES conversion unit 2. The video PES conversion unit2 converts the video ES into a video PES and outputs it to an A/V mixer5. Alternatively, the video PES conversion unit 2 may directly outputthe video ES received from the video encoder 1 to the A/V mixer 5. Thevideo PES conversion unit 2 also converts video TS packets input from ademultiplexer 7 into video PES packets, and outputs them to the A/Vmixer 5.

An audio encoder 3 encodes an input audio baseband signal according tothe MPEG method so as to generate an audio ES, and outputs it to anaudio PES conversion unit 4. The audio PES conversion unit 4 convertsthe audio ES received from the audio encoder 3 into an audio PES andoutputs it to the A/V mixer 5. Alternatively, the audio PES conversionunit 4 may directly output the audio ES to the A/V mixer 5. The audioPES conversion unit 4 also converts audio TS packets input from thedemultiplexer 7 into audio PES packets and outputs them to the A/V mixer5.

The A/V mixer 5 converts the video PES packets received from the videoPES conversion unit 2 and the audio PES packets received from the audioPES conversion unit 4 into a predetermined recording format (discussedlater), and outputs the resulting sync blocks to a recording unit 6. TheA/V mixer 5 also adds a time stamp to the TS packets input from thedemultiplexer 7, and converts them to a predetermined recording format.The resulting sync blocks are then output to the recording unit 6. TheA/V mixer 5 adds a time stamp to a video ES editing unit (describedbelow) which has passed through the video PES conversion unit 2 withoutbeing converted into a PES and an audio ES editing unit (describedbelow) which has passed through the audio PES conversion unit 4 withoutbeing converted into a PES, and converts them to a predeterminedrecording format. The resulting sync blocks are then output to therecording unit 6.

The recording unit 6 then randomizes the sync blocks received from theA/V mixer 5 according to the M sequence, as in the DV format used inconventional consumer digital VCRs. Subsequently, the recording unit 6restricts the run length and superimposes the tracking frequenciesaccording to 24-to-25 conversion, and records the randomized sync blockson a magnetic tape 9.

The demultiplexer 7 outputs video TS packets contained in a received TSto the video PES conversion unit 2, audio TS packets to the audio PESconversion unit 4, and also, outputs TS packets of program systeminformation (PSI) to the A/V mixer 5. The demultiplexer 7 also breaks upan input non-native TS (discussed later) into the individual TS packets,and outputs them to the A/V mixer 5. The demultiplexer 7 may discard thePCR packets.

A playback unit 10 reads the sync blocks recorded on the magnetic tape 9so as to play back the PESs, and outputs them to an A/V separator 11 ora TS conversion unit 14. The playback unit 10 also reads the sync blocksrecorded on the magnetic tape 9 so as to play back the TSs, and outputsthem to the A/V separator 11 or the TS conversion unit 14.

The A/V separator 11 separates the PESs or the TSs received from theplayback unit 10 into a video data stream and an audio data stream, andoutputs them to a video decoder 12 and an audio decoder 13,respectively.

The video decoder 12 decodes the video data stream received from the A/Vseparator 11 and outputs the resulting video signal. The audio decoder13 decodes the audio data stream received from the A/V separator 11 andoutputs the resulting audio signal.

The TS conversion unit 14 converts the PESs received from the playbackunit 10 into TSs and outputs them. The TS conversion unit 14 also adds async byte (discussed below) to the head of TS packets from which a syncbyte is eliminated.

A controller 16 controls a drive 17 to cause it to read a controlprogram stored in a magnetic disk 18, an optical disc 19, amagneto-optical disk 20, or a semiconductor memory 21, and controls theindividual elements of the AV recording/playback apparatus based on theread control program.

A recording method employed in the AV recording/playback apparatusconstructed as described above is discussed below. FIG. 2 illustrates anexample of the arrangement of ESs on the magnetic tape 9. As shown inFIG. 2, for video signals, every group of three frames, such as an Ipicture, a B picture, and a B picture, or a P picture, a B picture, anda B picture, forms a video editing unit. For audio signals, thecorresponding audio editing unit is disposed between the video editingunits.

In FIG. 2, an audio editing unit formed of four frames (equivalent toaudio access units (AAU)) or an audio editing unit formed of five framesis disposed between the three-frame video editing units.

In actuality, however, the number of audio frames for the three-framevideo editing units is not an integer. Thus, a special time stamp(T.S.), which represents the playback time, is added to each video oraudio editing unit. By virtue of the time stamps, a video signal and anaudio signal can be read in synchronization with each other.

The method for recording the ESs on the magnetic tape 9, as shown inFIG. 2, is referred to as the “ES recording method”. According to the ESrecording method, a video editing unit provided with a special timestamp and the corresponding audio editing unit provided with a specialtime stamp are disposed adjacent to each other. It is thus possible toavoid temporal displacement in the continuity between a video frame andan audio frame when they are spliced.

FIG. 3 illustrates an example of the arrangement of PESs on the magnetictape 9. More specifically, instead of adding the special time stampsshown in FIG. 2, according to the syntax of PES packets, a presentationtime stamp (PTS) indicating playback output time management informationand a decoding time stamp (DTS) indicating decoding time managementinformation are added to a three-frame video editing unit and thecorresponding audio editing unit so as to form a PES packet.

The method for recording the video frames and audio frames on themagnetic tape 9 as shown in FIG. 3 is referred to as the “PES recordingmethod”. The PES recording method is advantageous over the ES recordingmethod in the following respect. In reading the PESs from the magnetictape 9 and outputting them as TSs, the PESs are easily converted intoTSs because of the addition of PTSs and DTSs.

The structure of the PES packets is not unique. Concerning videopackets, for example, one PES packet may be formed of one video frame ora GOP having a plurality of video frames. Regarding audio packets, forexample, one PES packet may be formed of one audio frame (AAU) or aplurality of audio frames.

To facilitate the editing operation, the PES structure used in the PESrecording method is standardized for both video packets and audiopackets so that one frame forms one PES packet.

Before describing the recording format suitable for recording PESs onthe magnetic tape 9, the data structure of a TS packet and that of a PESpacket are discussed below. The recording format, which is discussedbelow, is applicable when ESs are recorded on the magnetic tape 9. Therecording format is also applicable to TSs to, for example,multi-program TSs.

FIG. 4 illustrates the data structure of a TS packet. The TS packet is afixed-length (188 bytes) packet formed of an eight-bit sync byte(sync_byte), a one-bit transport error indicator(transport_error_indicator), a one-bit payload unit start indicator(payload_unit_start_indicator), a one-bit transport priority(transport_priority), 13-bit packet ID information (packet_ID), two-bitscrambling control (transport_scrambling_control), two-bit adaptationfield control (adaptation_field_control), a four-bit continuity counter(continuity_counter), and a 184-byte adaptation field.

The sync byte indicates the head of the TS packet. The transport errorindicator indicates the presence or the absence of a bit error in the TSpacket. The payload unit start indicator indicates that the head of aPES packet is recorded in the payload of the TS packet. The packetpriority designates the priority level of the TS packet. The packet IDinformation represents the attributes of the individual streams of theTS packet. The scrambling control indicates the presence or the absenceand the type of scrambling of the payload of the TS packet. Theadaptation field control indicates the presence or the absence of theadaptation field and that of the payload. The continuity counterdesignates the order of a plurality of TS packets having the same packetID Information.

In the adaptation field, not only the PCR, but also additionalinformation of the individual streams, are recorded. If the additionalinformation to be recorded in the adaptation field is less than 184bytes, stuffing bytes are filled in the adaptation field. In thepayload, the divided PES packets, PSI, etc., are recorded.

FIG. 5 illustrates the data structure of the PES packet. The PES packetis a variable-length packet formed of a 32-bit packet start code, a16-bit PES packet length, two-bit “10”, 14-bit flag and control, aneight-bit PES header data length, a 40-bit PTS, a 40-bit DTS, 152 bitsof other information, a PES header having 8N-bit stuffing bytes, and avariable-length payload.

The packet start code represents the head of the PES packet and containsa 24-bit header start code and an eight-bit stream ID. In the PES packetlength, the data length of the PES packet is recorded. “10” after thePES packet length indicates that the packet is a PES packet. In the flagand control, the presence or the absence and the type of scrambling ofthe PES packet, the priority, copyright information, etc., are recorded.In the PES header data length, the data length of the PES header isrecorded.

The recording format of the magnetic tape 9 is discussed below withreference to FIG. 6. On one track of the magnetic tape 9, 141 syncblocks (hereinafter referred to as “SBs”), are recorded. An errorcorrecting C2 parity is recorded by using 9 SBs at each side of thetrack. In the remaining 123 SBs sandwiched between the C2 parities, maindata (for example, PES packets) is recorded.

An SB, having a fixed length of 111 bytes, is formed of a two-byte sync,a three-byte ID, a one-byte SB header, a 95-byte data area, and a10-byte error correcting C1 parity.

In the three-byte ID, a track number, an SB number, and an overwriteprotect code are recorded. The overwrite protect code is updated everytime information is overwritten on the same SB and prevents previousdata from remaining recorded.

FIG. 7 illustrates information to be recorded in the one-byte(eight-bit) SB header. The three most significant bits (MSBs) (bit-7through bit-5 in FIG. 7) of the SB header represent the type of datarecorded on the 95-byte data area subsequent to the SB header. Theinformation recorded in the five least significant bits (LSBs) (bit-4through bit-0 in FIG. 7) is varied according to the data type.

When the three MSBs of the SB header indicate 000, the data type isPES-VIDEO. When the three MSBs indicate 001, the data type is PES-AUDIO.When the data type is PES-VIDEO or PES-AUDIO, a full/partial flag isrecorded in the fourth MSB bit (bit-4 in FIG. 7). In the subsequent fourLSB bits (bit 3 through bit 0 in FIG. 7), the continuity count valuerepresenting the continuity of the SBs of the same data type isrecorded.

FIG. 8 illustrates the SB data structure whose data type is PES-VIDEO orPES-AUDIO. If the whole 95-byte data area after the SB header isoccupied with PES packets, the full/partial flag of the SB headerindicates 0. If the data area is not totally occupied with PES packets,the full/partial flag indicates 1, and the data length of the PESpackets is recorded in one byte of the MSB of the data area.

Referring back to FIG. 7, when the three MSBs designate 010, the datatype is SEARCH-DATA. In this case, a video/audio flag is recorded in thefourth MSB of the SB header, and the search speed is recorded in thesubsequent three bits. The remaining one bit is reserved. In the dataarea, fixed-size search data is recorded. The positions of the SBs onthe track whose data type is SEARCH-DATA are predetermined, and the SBswhose data type is other than SEARCH-DATA are located to avoid the SBswhose data type is SEARCH-DATA.

When the three MSBs of the SB header indicate 011, the data type is AUX.In this case, the AUX mode is recorded in the fourth through sixth MSBsof the SB header. The remaining two bits are reserved. In the data area,fixed-size AUX data (auxiliary information) is recorded.

The three-bit AUX mode indicates the type of AUX data. When the threebits indicate 000, the AUX mode is AUX_V, and AUX data accompanied withthe video data is recorded in the data area. When the three bitsdesignate 001, the AUX mode is AUX₁₃A, and AUX data accompanied with theaudio data is recorded in the data area. When the three bits indicate010, the AUX mode is PSI-1, and the first half of the TS packet of thePSI is recorded in the data area. When the three bits indicate 011, theAUX mode is PSI-2, and the second half of the TS packet of the PSI isrecorded in the data area. When the three bits indicate 100, the AUXmode is SYSTEM, and system AUX data is recorded in the data area.

FIG. 9 illustrates the data structure of an SB whose data type is AUXand whose AUX mode is PSI-1 or PSI-2. The first three bytes of the dataarea of an SB whose AUX mode is PSI-1 are reserved. In the subsequent 92bytes, 92 bytes of the first half of the TS packet (188 bytes) of thePSI, except for the one-byte sync byte (sync_byte), are recorded. In thedata area of an SB whose AUX mode is PSI-2, 95 bytes of the second halfof the TS packet of the PSI corresponding to the first half recorded inthe data area of the SB whose AUX mode is PSI-1 are recorded. That is,one TS packet of the PSI is divided and recorded in two types of SBswhose AUX modes are PSI-1 and PSI-2.

Referring back to FIG. 7, When the three MSBs of the SB header designate100, the data type is TS-1. In this case, the fourth and fifth MSBs ofthe SB header are reserved. In the remaining three bits and the firstthree bytes (24 bits) of the subsequent data area, a 27-bit time stampis recorded.

When the three MSBs of the SB header indicate 101, the data type isTS-2. In this case, in the five LSBs, the continuity count value isrecorded.

FIG. 10 illustrates the data structure of an SB whose data type is TS-1or TS-2. As discussed above, the first three bytes of the data area ofan SB whose data type is TS-1 are used for recording a 27-bit time stampin combination with the three LSBs of the SB header. In the subsequent92 bytes of the data area, 92 bytes of the first half of the TS packet(188 bytes), except for the sync byte (sync_byte) of the head, arerecorded. In the data area whose data type is TS-2, 95 bytes of thesecond half of the TS packet corresponding to the first half recorded onthe data area of the SB whose data type is TS-1 are recorded.

That is, one TS packet is divided and recorded in two types of SBs whosedata type are TS-1 and TS-2. The continuity count value recorded in theSB header whose data type is TS-2 indicates the continuity of the TSpacket recorded in the TS-1 SB and TS-2 SB.

Referring back to FIG. 7, when the three MSBs of the SB header indicate110, the data type is NULL. In this case, in the data area, invalid datawhich is only used for achieving the recording rate is recorded. Thedata bytes recorded after the SB header whose data type is NULL areignored.

When the three MSBs of the SB header indicate 111, the data type isundefined (reserved).

A description is given below, with reference to FIGS. 11 through 14, ofthe four types of recording processing performed by the AVrecording/playback apparatus of the present invention. FIGS. 11 through14 illustrate the concepts of the recording processing. In the followingdescription, ESs, PESs, and TSs consisting of PESs, formed by the videoencoder 1, the video PES conversion unit 2, the audio encoder 3, and theaudio PES conversion unit 4 are referred to as “native ESs”, “nativePESs”, and “native TSs”, respectively, and the other ESs, PESs, and TSsare referred to as “non-native ESs”, “non-native PESs”, and “non-nativeTSs”, respectively.

According to the first recording processing, as shown in FIG. 11, anative ES is formed into a PES, and the PES is recorded as a native PES.According to the second recording processing, as shown in FIG. 12, anative TS is formed into a PES, and the PES is recorded as a native PES.

According to the third recording processing, as illustrated in FIG. 13,a non-native TS is formed into ESs, the ESs are then formed into PESs,and the PESs are recorded as a non-native PES. The third recordingprocessing is applicable only when the TS is not a multi-program but asingle program, and vbv₁₃delay is added to the video ES. The reason isas follows. If vbv₁₃delay is not added (that is, if 0xFFFF is recordedin vbv_delay), the arrival time information is lost when a TS is formedinto a PES, and a TS cannot be read during a playback operation.

According to the fourth recording processing, as illustrated in FIG. 14,a time stamp is added to a non-native TS, and the TS is recorded as anon-native TS. The fourth recording processing is applicable to TSswhich do not satisfy the above-described condition under which the thirdrecording processing can be applied.

The first through fourth recording types of processing are morespecifically discussed below.

A description is first given of the first recording processing withreference to the flow chart of FIG. 15. In step S1, the video encoder 1encodes an input video baseband signal according to the MPEG method soas to generate a video ES, and outputs it to the video PES conversionunit 2. In this case, the video baseband signal is accurately encoded ata bit rate equivalent to the maximum bit rate to be recorded in thesequence header. A precise value is recorded in vbv_delay of the pictureheader.

The audio encoder 3 encodes an input audio baseband signal according tothe MPEG method so as to generate an audio ES, and outputs it as theaudio PES conversion unit 4.

In step S2, the video PES conversion unit 2 adds a PES header includingthe PTS and the DTS to each video frame of the video ES received fromthe video encoder 1 so as to generate PES packets, and outputs them tothe A/V mixer 5.

Meanwhile, the audio PES conversion unit 4 adds a PES header includingthe PTS and the DTS to each audio frame (AAU) of the audio ES receivedfrom the audio encoder 3 so as to generate PES packets, and outputs themto the A/V mixer 5.

In step S3, the A/V mixer 5 selects three PES packets, i.e., an Ipicture, a B picture, and a B picture, or a P picture, a B picture, anda B picture, from the video PES packets output from the video PESconversion unit 2, and combines the three PES packets into an editingunit. The A/V mixer 5 also sets the earliest value of the PTS time ofthe three frame images to PTS1, and the earliest value of the PTS timeof the subsequent three frame images to PTS2. Then, the A/V mixer 5combines audio PES packets having a PTS after PTS1 and before PTS2 intoan editing unit, and alternately and sequentially places the audioediting unit and the video editing unit, thereby generating a mixed PES.

In step S4, the A/V mixer 5 generates an SB whose data type is AUX andwhose AUX mode is AUX_V or AUX_A, and records auxiliary information,such as copyright information, in the data area of the SB, and theninserts the AUX SB at the boundaries of the mixed PESs.

In step S5, the A/V mixer 5 divides each of the alternately disposedvideo PES packets and the audio PES packets into 95-byte units so thatthey can be placed in the data areas of SBs whose data type is PES_VIDEOor PES_AUDIO. As has been discussed with reference to FIG. 8, when thedivided PES packet has 95 bytes and occupies the whole data area of theSB, the A/V mixer 5 records 0 in the full/partial flag of the SB header.In contrast, when the divided PES packet has less than 95 bytes and doesnot fill the whole data area (95 bytes) of the SB, the A/V mixer 5records the data length in the first byte of the header of the dividedPES packet and also records 1 in the full/partial flag of the SB header.

In step S6, the A/V mixer 5 records the continuity count value in the SBheader of each SB whose data type is PES_VIDEO or PES_AUDIO. Then, theA/V mixer 5 adds the SB header to each 95-byte PES packet obtained instep S5. The generated SBs are stored in a memory device which is formedin the interleave units and is built in the A/V mixer 5.

The A/V mixer 5 also generates SBs whose data type is SEARCH_DATA inwhich search data is recorded, and SBs whose data type is AUX in whichsystem auxiliary information is recorded and whose AUX mode is SYSTEM.The generated SBs are stored at predetermined positions of the memorydevice integrated in the A/V mixer 5.

If the generated SBs do not meet the recording rate of the magnetic tape9, the A/V mixer 5 generates SBs whose data type is NULL. The generatedSBs are stored in the memory device built in the A/V mixer 5.

In step S7, after generating a C2 parity for one track of SBs, the A/Vmixer 5 adds a C1 parity to the end of each SB and starts outputting theSBs to the recording unit 6 in accordance with the order of the SBs tobe recorded on the magnetic tape 9.

In step S8, the recording unit 6 randomizes the SBs sequentiallyreceived from the A/V mixer 5 according to the M sequence, as in the DVformat used in conventional consumer digital VCRs. Thereafter, therecording unit 6 restricts the run length and superimposes the trackingfrequencies according to 24-to-25 conversion, and then records therandomized SBs on the magnetic tape 9.

The second recording processing is now discussed with reference to theflow chart of FIG. 16. The second recording processing starts when it isdetermined based on information recorded in the descriptor of a programmap table (PMT), which is input together with the TS into thedemultiplexer 7, that the TS is native.

In step S11, the demultiplexer 7 separates an input TS into a video TSpacket and an audio TS packet, and outputs them to the video PESconversion unit 2 and the audio PES conversion unit 4, respectively. Inthis case, the demultiplexer 7 detects the occurrence of an error in TSpackets or the discontinuity of TS packets based on the transport errorindicator or the continuity counter, respectively, disposed at theheader of the TS packet, and discards such TS packets. The demultiplexer7 also reports the occurrence or an error or the discontinuity of TSpackets to the A/V mixer 5 via the controller 16. Moreover, thedemultiplexer 7 discards the PCR contained in the TS.

The video PES conversion unit 2 reconstructs the video PES packets fromthe video TS packets received from the demultiplexer 7, and outputs themto the A/V mixer 5. The video PES conversion unit 2 also extractsauxiliary information, such as copyright information, from the video TSpackets and outputs it to the A/V mixer 5. Since the reconstructed videoPES packets are native, each PES packet is formed of one video frame.

Meanwhile, the audio PES conversion unit 4 reconstructs audio PESpackets from the audio TS packets input from the demultiplexer 7, andoutputs them to the A/V mixer 5. The audio PES conversion unit 4 alsoextracts auxiliary information, such as copyright information, from theaudio TS packets, and outputs it to the A/V mixer 5. Since thereconstructed audio PES packets are native, each PES packet is formed ofone frame (AAU).

The A/V mixer 5 selects three PES packets, i.e., an I picture, a Bpicture, and a B picture, or a P picture, a B picture, and a B picture,from the video PES packets received from the video PES conversion unit2, and combines the three PES packets into an editing unit. The A/Vmixer 5 also sets, as shown in FIG. 17, the earliest PTS time of thecombined three frame images to PTS1, and the earliest PTS time of thesubsequent three frame images to PTS2. Then, the A/V mixer 5 combinesaudio PES packets having a PTS after PTS1 and before PTS2 into anediting unit, and alternately and sequentially disposes the audioediting unit and the video editing unit, thereby generating a mixed PES.FIG. 17 illustrates a delay time before recording the input TS as a PESaccording to the second recording processing.

In step S12, the A/V mixer 5 generates an SB whose data type is AUX andwhose AUX mode is AUX_V, and records the auxiliary information, such ascopyright information, input from the video PES conversion unit 2 in thedata area of the SB, and couples the SB to the audio PES packets.

In step S13, the A/V mixer 5 divides each of the video PES packets andthe audio PES packets into 95-byte units, so that they can be disposedin the data areas of the SBs whose data type is PES_VIDEO or PES_AUDIO.As has been described with reference to FIG. 8, when the divided PESpacket has 95 bytes and occupies the whole data area of the SB, the A/Vmixer 5 records 0 in the full/partial flag of the SB header. Incontrast, when the divided PES packet is short of 95 bytes and does notoccupy the whole data area (95 bytes) of the SB, the A/V mixer 5 recordsthe data length in the first byte of the header of the PES packet andalso records 1 in the full/partial flag of the SB header.

In step S14, the A/V mixer 5 records the continuity counter value in theSB header of an SB whose data type is PES_VIDEO or PES_AUDIO, therebycompleting the SB header. Then, the A/V mixer 5 adds the SB header toeach 95-byte PES packet obtained in step S13, thereby generating theSBs. The generated SBs are then stored in a memory device, which isformed in interleave units and is built in the A/V mixer 5.

The A/V mixer 5 then generates SBs whose data type is SEARCH_DATA and inwhich search data is recorded, and SBs whose data type is AUX and whoseAUX mode is SYSTEM and in which system auxiliary information isrecorded. The generated SBs are stored in predetermined positions of thememory devices built in the A/V mixer 5.

If the generated SBs do not meet the recording rate of the magnetic tape9, the A/V mixer 5 generates SBs whose data type is NULL. The generatedSBs are stored in the memory device integrated in the A/V mixer 5.

If the occurrence of an error or the discontinuity of TS packets isreported from the demultiplexer 7 via the controller 16, the A/V mixer 5records data in the following manner in steps 13 and 14. That is, if odddata before the occurrence of an error still remains, the A/V mixer 5records data in an SB by turning on the partial flag, and startsrecording data after the occurrence of an error in a new SB. The A/Vmixer 5 also effectively records a discontinuous value in the continuitycounter of the new SB header so as to identify the position at which theerror has occurred when a playback operation is performed.

In step S15, after generating a C2 parity for one track of SBs, the A/Vmixer 5 adds a C1 parity to the end of each SB and starts outputting theSBs to the recording unit 6 in accordance with the SBs to be recorded onthe magnetic tape 9.

In step S16, the recording unit 6 then randomizes the SBs sequentiallyreceived from the A/V mixer 5 according to the M sequence, as in the DVformat used in conventional consumer digital VCRs. Subsequently, therecording unit 6 restricts the run length and superimposes the trackingfrequencies according to 24-to-25 conversion, and records the randomizedSBs on a magnetic tape 9.

A description of the third recording processing is given below withreference to the flow chart of FIG. 18. The third recording processingcommences when it is determined based on information recorded in thedescriptor of a PMT, which is input together with the TS into thedemultiplexer 7, that the TS is a non-native and also satisfies theconditions (the TS is a single program and vbv_delay is added to thevideo ES) to which the third recording processing is applicable.

In step S21, the demultiplexer 7 separates an input TS into a video TSpacket and an audio TS packet, and outputs them to the video PESconversion unit 2 and the audio PES conversion unit 4, respectively. Inthis case, the demultiplexer 7 detects the occurrence of an error or thediscontinuity of TS packets based on the transport error indicator orthe continuity counter, respectively, indicated in the header of the TSpackets, and discards the corresponding TS packets. The demultiplexer 7then reports the occurrence of an error or the discontinuity of TSpackets to the A/V mixer 5 via the controller 16. The demultiplexer 7also detects TS packets of the PSI from the TS and supplies them to theA/V mixer 5. Moreover, the demultiplexer 7 discards the PCR contained inthe TS.

The video PES conversion unit 2 reconstructs the video PES packets fromthe video TS packets input from the demultiplexer 7, and determineswhether each video PES packet is formed of one video frame. If not, thevideo PES conversion unit 2 converts the video PES packet into a videoES, and interpolates a PTS and a DTS so as to convert the video ES intoa PES packet equivalent to a native PES packet formed of one frame. Theresulting PES packet is then output to the A/V mixer 5. The video PESconversion unit 2 also extracts auxiliary information, such as copyrightinformation, from the video TS packet, and outputs it to the A/V mixer5.

Meanwhile, the audio PES conversion unit 4 reconstructs the audio PESpackets from the audio TS packets input from the demultiplexer 7, anddetermines whether each audio PES packet is formed of one audio frame(AAU). If not, the audio PES conversion unit 4 converts the audio PESpacket into an audio ES and interpolates a PTS so as to convert the ESpacket into a PES packet equivalent to a native PES packet formed of oneframe. The resulting PES packet is then output to the A/V mixer 5. Theaudio PES conversion unit 4 also extracts auxiliary information, such ascopyright information, from the audio TS packets, and outputs it to theA/V mixer 5.

In step S22, the A/V mixer 5 selects three PES packets, i.e., an Ipicture, a B picture, and a B picture, or a P picture, a B picture, anda B picture, from the video PES packets received from the video PESconversion unit 2, and combines the three PES packets into an editingunit. The A/V mixer 5 also sets the earliest value of the PTS time ofthe three frame images to PTS1, and the earliest value of the PTS timeof the subsequent three frame images to PTS2. Then, the A/V mixer 5combines audio PES packets having a PTS after PTS1 and before PTS2 intoan editing unit, and alternately and sequentially disposes the audioediting unit and the video editing unit, thereby generating a mixed PES.

In step S23, the A/V mixer 5 generates an SB whose data type is AUX andwhose AUX mode is AUX_V, and records the auxiliary information, such ascopyright information, input from the video PES conversion unit 2 in thedata area of the SB, thereby coupling the SB to the video PES packet.The A/V mixer 5 also generates an SB whose data type is AUX and whoseAUX mode is AUX_A, and records the auxiliary information, such ascopyright information, input from the audio PES conversion unit 4, inthe data area of the SB, thereby coupling the SB to the audio PESpackets. Moreover, the A/V mixer 5 generates SBs whose data type is AUXand whose AUX mode is PSI-1 or PSI-2, and records the first half of theTS packet of the PSI received from the demultiplexer 7 in the data areaof the PSI-1 SB, and the second half of the TS packet of the PSI in thedata area of the PSI-2 SB.

In step S24, the A/V mixer 5 divides each of the video PES packets andthe audio PES packets into 95-byte units so that they can be disposed inthe data areas of the SBs whose data type is PES_VIDEO or PES_AUDIO. Ashas been described with reference to FIG. 8, when the divided PES packethas 95 bytes and occupies the whole data area of the SB, the A/V mixer 5records 0 in the full/partial flag of the SB header. In contrast, whenthe divided PES packet is short of 95 bytes and does not occupy thewhole data area (95 bytes) of the SB, the A/V mixer 5 records the datalength in the first byte of the head of the PES packet and also records1 in the full/partial flag of the SB header.

In step S25, the A/V mixer 5 records the continuity counter value in theSB header of an SB whose data type is PES_VIDEO or PES_AUDIO, therebycompleting the SB header. Then, the A/V mixer 5 adds the SB header toeach 95-byte PES packet obtained in step S24, thereby generating theSBs. The generated SBs are then stored in a memory device, which isformed in interleave units and is built in the A/V mixer 5.

The A/V mixer 5 then generates SBs whose data type is SEARCH_DATA and inwhich search data is recorded, and SBs whose data type is AUX and whoseAUX mode is SYSTEM. The generated SBs are stored in predeterminedpositions of the memory devices integrated in the A/V mixer 5.

If the generated SBs do not meet the recording rate of the magnetic tape9, the A/V mixer 5 generates SBs whose data type is NULL. The generatedSBs are stored in the memory device integrated in the A/V mixer 5.

If the occurrence of an error or the discontinuity of TS packets isreported from the demultiplexer 7 via the controller 16, the A/V mixer 5records data in the following manner in steps 24 and 25. That is, if odddata before the occurrence of an error still remains, the A/V mixer 5records data in an SB by turning on the partial flag, and startsrecording data after the occurrence of an error in a new SB. The A/Vmixer 5 also effectively records a discontinuous value in the continuitycounter of the new SB header so as to identify the position at which theerror has occurred when a playback operation is performed.

In step S26, after generating a C2 parity for one track of SBs, the A/Vmixer 5 adds a C1 parity to the end of each SB, and starts outputtingthe SBs to the recording unit 6 in accordance with the order of the SBsto be recorded on the magnetic tape 9.

In step S27, the recording unit 6 then randomizes the SBs sequentiallyreceived from the A/V mixer 5 according to the M sequence, as in the DVformat used in conventional consumer digital VCRs. Subsequently, therecording unit 6 restricts the run length and superimposes the trackingfrequencies according to 24-to-25 conversion, and records the randomizedSBs on the magnetic tape 9.

The fourth recording processing is now described with reference to theflow chart of FIG. 19. The fourth recording processing begins when it isdetermined based on information recorded in the descriptor of a PMT,which is input together with the TS into the demultiplexer 7, that theTS is non-native and does not satisfy the condition under which thethird recording processing is applicable (i.e., when it is determinedthat the TS is not a single program or vbv_delay is not added to thevideo ES).

In step S31, the demultiplexer 7 separates an input non-native TS intothe individual TS packets, and outputs them to the A/V mixer 5. The A/Vmixer 5 removes the first sync byte from the input TS packet, and thendivides the TS packet into the first half of 92 bytes and the secondhalf of 95 bytes. Subsequently, the A/V mixer 5 records the first halfof 92 bytes in the data area of an SB whose data type is TS-1, and thesecond half of 95 bytes in the data area of an SB whose data type isTS-2.

In step S32, the A/V mixer 5 adds a time stamp indicating the arrivaltime to 27 bits which consist of the three LSBs of the SB header whosedata type is TS-1 generated in step S31 and the three bytes of the headof the data area.

In step S33, the A/V mixer 5 records the continuity count valuerepresenting the continuity of the TS packets in the five LSBs of the SBheader whose data type is TS-2 generated in step S31. The generated SBsare stored in a memory device integrated in the A/V mixer 5. The TS-1 SBand the associated TS-2 SB are disposed so that they are in the closestproximity with each other. Even if the occurrence of an error or thediscontinuity of TS packets is detected, the TS packets are recorded inthe SBs.

The A/V mixer 5 also creates SBs whose data type is SEARCH_DATA and inwhich search data is recorded and SBs whose data type is AUX and whoseAUX mode is SYSTEM and in which system auxiliary information isrecorded. The created SBs are stored at predetermined positions of thememory device integrated in the A/V mixer 5.

When the generated SBs do not meet the recording rate of the magnetictape 9, the A/V mixer 5 generates SBs whose data type is NULL. Thegenerated SBs are stored in the memory device built in the A/V mixer 5.

In step S34, the A/V mixer 5 outputs the SBs to the recording unit 6 inaccordance with the order of the SBs to be recorded on the magnetic tape9. The recording unit 6 then randomizes the SBs sequentially receivedfrom the A/V mixer 5 according to the M sequence, as in the DV formatused in conventional consumer digital VCRs. Subsequently, the recordingunit 6 restricts the run length and superimposes the trackingfrequencies according to 24-to-25 conversion, and records the randomizedSBs on the magnetic tape 9.

A description is given below of the playback processing performed by theA/V recording/playback apparatus of the present invention. The A/Vrecording/playback apparatus performs normal playback processing, suchas reading and decoding the PESs or the TSs recorded on the magnetictape 9 by one of the above-described four types of recording processing,and then outputting the resulting video signals and audio signals. TheA/V recording/playback apparatus also reads the PESs recorded on themagnetic tape 9 and converts them to TSs, and outputs the TS.

The TS output processing executed by the A/V recording/playbackapparatus is discussed below with reference to the flow chart of FIG. 20and the diagram of FIG. 22. The TS output processing starts when thesupply of PES packets (including error corrections based on paritydata), which are reconstructed from the SBs sequentially read from themagnetic tape 9 by the playback unit 10, to the TS conversion unit 14begins, and also when a PES packet of an I picture is detected. A delayperiod created before outputting the read PESs as TSs is shown in FIG.21.

In step S41 (corresponding to processing 1 in FIG. 22), the TSconversion unit 14 reads the DTS from the PES header of an I picture andalso reads vbv_delay from the picture header so as to calculateDTS-(vbv_delay). The TS conversion unit 14 then subtracts apredetermined period from DTS-(vbv_delay) so as to initialize a systemtime clock (STC), and starts a STC counter.

In step S42 (corresponding to processing 2 in FIG. 22), the TSconversion unit 14 generates PSI packets of a program association table(PAT) and a PMT and outputs them at regular intervals. Accordingly, atthe receiving side of the TS, the PAT and the PMT can be received beforethe video and audio TS packets, thereby preventing the header GOP frommissing.

In step S43 (corresponding to processing 3 in FIG. 22), the TSconversion unit 14 outputs PCR packets which store the STC values atcertain intervals.

In step S44 (corresponding to processing 4 in FIG. 22), the TSconversion unit 14 start converting the video PES packet into TSs andoutputting them by synchronizing the time (DTS-(vbv_delay)) obtained bysubtracting vbv_delay from the DTS of the first I picture with the STC.The same applies to the other pictures. Since the DTS is not recorded inthe B pictures, the PTS is used, and the processing is similarlyperformed.

The TS conversion unit 14 also starts converting audio PES packets intoTSs and outputting them by synchronizing the time obtained bysubtracting the start up delay from the PTS of the first frame (AAU)with the STC (corresponding to processing 5 in FIG. 22). It is necessarythat the audio output rate be exactly the same as the value recorded inthe bit rate index (bitrate_index) of the header.

The A/V recording/playback apparatus may also output the TSs recorded onthe magnetic tape 9 as the TSs.

In relation to the TS output processing of the TS conversion unit 14,the output interval of the video TS packets, the handling of theauxiliary (AUX) data, the output processing of non-native TSs recordedon the magnetic tape 9, error handling in the PES recording, and errorhandling in the TS recording are discussed below.

The output interval of the video TS packets are as follows. When a valueother than 0xFFFF is recorded as vbv_delay in the picture header of aPES which is read from the magnetic tape 9, and when the bit rate(bit_rate) value of the sequence header coincides with the output rate,it can be concluded that the PES is native. In this case, the PES isconverted into a TS at a rate slightly higher than the above-describedbit rate, and when the PESs of the picture are completely converted intoTSs, the TS conversion unit 14 waits until the data of the subsequentpicture is input.

On the other hand, when vbv_delay is not added to the picture header ofthe PES read from the magnetic tape 9 (i.e., when 0xFFFF is recorded),or when the bit rate (bit_rate) of the sequence header does not coincidewith the output rate, it can be concluded that the PES is non-native. Inthis case, the interval from one picture to the subsequent picture(DTS-(vbv_delay) is divided by the number of bits of the former picture,and the TS conversion unit 14 outputs the TSs at intervals of theresulting value.

The handling of the AUX data is as follows. When the PESs read from themagnetic tape 9 are native, the AUX data is recorded in SBs whose datatype is AUX_V or AUX_A according to the above-described first or secondrecording processing. Accordingly, in the TS output processing, the AUXdata recorded in an AUX_V SB or an AUX_A SB is directly carried on theTS packets, and the TS packets are output. It should be noted that theAUX_V data is coupled to the video PES, and the AUX_A data is coupled tothe audio PES. Thus, the AUX data is converted into a TS insynchronization with the video PES or the audio PES, and the TS is thenoutput.

The PMT which is specially used for native data is created. In the PMT,PIDs of video data, audio data, AUX data, and a PCR are recorded.Copyright information, which is part of the AUX data, is recorded in thePMT so that it can be identified even in general-purpose machines. Thedescriptor, which indicates that the PES is native, is also recorded inthe PMT.

When the PES read from the magnetic tape 9 is non-native, the PAT, PMT,and SIT, which form the AUX data, are recorded in the SBs whose datatype is AUX and whose AUX mode is PSI-1 or PSI-2. Accordingly, the PESis simply returned to the TS packet, and the TS packet is output. Whenreturning the PES to the TS packet, the values recorded in the PMT areused as the PIDs of the video data, the audio data, and the PCR, therebyeliminating the need for overwriting the PMT and the cyclic redundancycheck (CRC) value.

A description is given below of the output processing of non-native TSsrecorded on the magnetic tape 9. Since a time stamp is recorded in theTSs recorded on the magnetic tape 9 by the aforementioned fourthrecording processing, the TSs are output when the time stamp coincideswith the STC during a playback operation. The sync byte has been removedfrom the TS header read from the magnetic tape 9 according to the fourthrecording processing. Accordingly, the sync byte is added to the TSheader, and the TS is then output.

Error handling of data recorded as PESs based on the continuity counterof the SB header is described below with reference to FIG. 23. The datatype of an SB is recorded in the SB header according to one of thefirst, second, and third recording processing. Accordingly, in case ofthe occurrence of an uncorrectable error in the SB, the data typebecomes unknown.

Thus, based on the continuity of the values of the continuity counterrecorded in the SB header of an SB without an error, the data type ofthe SB having an uncorrectable error is determined.

More specifically, the values of the continuity counters of the SBswhose data type is PES-VIDEO are monitored, and when the discontinuityof the values of the continuity counters of the SBs before and after anSB having an uncorrectable error is detected, it can be proved that thedata type of the SB having an error is PES-VIDEO. Similarly, the valuesof the continuity counters of the SBs whose data type is PES-AUDIO aremonitored, and when the discontinuity of the values of the continuitycounters of the SBs before and after an SB having an error is detected,it can be proved that the data type of the SB having an uncorrectableerror is PES-AUDIO.

Accordingly, it can be determined whether an error has occurred in an SBin which a PES is recorded. It is thus possible to reduce an adverseinfluence on the read video and audio data caused by the occurrence ofan error.

Even when an error has occurred at the boundary between a PES-VIDEO SBand a PES-AUDIO SB, the continuity between the value of the continuitycounter of the SB after the SB having an error and that of the lastcontinuity counter of the previous coupling unit can be checked, therebydetecting the occurrence of an error.

When the values of the continuity counters are continuous, the TSs arecontinuously output. In contrast, when the values of the continuitycounters are not continuous, and when the error is uncorrectable, anerror code is inserted. For inserting the error code in the ES layer,0x000001B4 of a sequence error code can be inserted. For the TS layer, apacket in which 1 is set can be output to the transport error indicator(transport_error_indicator).

The continuity counter value has four cyclic bits from 0 to 15.Accordingly, if SBs of the same data type are missing consecutively fora multiple number of 16, the continuity counter is unable to detect theerror. Thus, if 16 or more SBs having an uncorrectable error arecontinuous, an error code is inserted regardless of the data type ofSBs.

If error handling is executed even if an uncorrectable error does notoccur in SBs, a discontinuous value of the continuity countereffectively recorded during a recording operation can be handled as anerror.

A description is now given, with reference to FIG. 24, of the errorhandling of data recorded in TSs based on the continuity counter of theSB header. The data type of an SB is recorded in the SB header accordingto the fourth recording processing. Accordingly, in case of theoccurrence of an uncorrectable error, the data type of an SB becomesunknown.

Thus, based on the continuity of the value of the continuity counterrecorded in the SB header of an SB without an error, the data type of anSB having an uncorrectable error is detected.

More specifically, the data types of SBs without an error before andafter an uncorrectable SB are monitored. If the data types of SBs aresequentially from TS-1 to TS-2, the continuity between the value of thecontinuity counter recorded in the SB header of the TS-2 SB and that ofthe previous TS-2 SB is checked. If the two values are continuous, theTS-1 SB and the TS-2 SB are found to be a pair, and they arereconstructed into one TS packet. In contrast, if the two values are notcontinuous, the TS-1 SB and the TS-2 SB are not a pair, and both of themare discarded since the pairs thereof are missing.

The playback system is able to detect that the TSs have been discardedbased on the values of the continuity counter recorded in the TS headersof the TSs before and after the discarded TSs. It is thus possible toreduce an adverse influence of an error on the read video and audiodata.

If the data types of SBs are sequentially from TS-2 to TS-1, thecorresponding SBs are output without performing error handling. That is,even if the data type of an uncorrectable SB is TS-1 or TS-2, theplayback system is able to identify the occurrence of an error based onthe discontinuity of the value of the continuity counter of the TSheader.

If the data types are sequentially from TS-1 to TS-1, the previouslyread TS-1 SB is discarded. This can be identified by the playback systembased on the discontinuity of the value of the continuity counter of theTS header.

If the data types are sequential from TS-2 to TS-2, the TS-2 SB whichhas been read later is discarded. This can be identified by the playbacksystem based on the discontinuity of the value of the continuity counterof the TS header.

As is seen from the foregoing description, the AV recording/playbackapparatus of the present invention offers the following advantages.

In recording video signals and audio signals in the form of ESs, theoverhead of the recording rate can be minimized. In recording videosignals and audio signals in the form of PESs, PESs can easily beconverted into TSs. According to the ES or PES recording, processingrequired for jog playback is reduced, and it is not necessary to recorda TS header and a time stamp indicating the TS arrival time.Accordingly, the overhead can be reduced. Hence, space can be saved on arecording medium, or the recording time becomes longer. Additionally,since a PCR is not recorded, the overhead can be reduced, and space canalso be saved, or the recording time becomes longer.

Since one video frame forms one PES packet, a PTS is provided for allthe frames. Accordingly, the timing can easily be provided to convertPESs into TSs. The implementation of joy playback is also facilitated.Since one audio frame forms one PES packet, a PTS is provided for allthe frames. Accordingly, the timing can easily be provided to convertPESs into TSs. Additionally, in performing editing, audio data caneasily be divided, and not only native audio data, but also non-nativeaudio data can be edited. Although the data type is conventionallyidentified by the PID, it can be represented by the ID code having asmaller number of bits than the PID. The overhead can thus be reduced.

When the whole data area of an SB is occupied with effective data, it isnot necessary to record a byte indicating the data length, therebymaking the overhead smaller. When a PSI section is divided into aplurality of TS packets, the head of the TS packet can be indicated bythe payload unit start indicator of the TS packet header. Thus, the PSIcan be stored in two SBs whose data type is AUX.

Since the output of TSs is started from DTS-(vbv_delay), timing can beprovided without requiring the arrival time. TSs are output at a rateslightly higher than the recorded bit rate (bit_rate), therebypreventing TSs from interfering with each other at the boundary offrames. By outputting TSs at regular intervals, they can be output at anaverage rate even if the recorded bit_rate is much higher than theactual rate. Since the PCR is output before the first frame, theplayback system is able to load the PCR in the STC, and then receivesthe first frame. Accordingly, the head of the read data can be displayedwithout missing. Since the PAT and the PMT are output before the PCRpacket, the playback system is able to receive the whole PCR packets.The position at which an error has occurred can be identified, therebyreducing an adverse influence of the error on the image quality or thesound quality. The occurrence of an error detected during the recordingoperation can be reported to the playback system without increasing thenumber of bits.

The present invention is also applicable when AV signals are recorded oninformation recording media other than magnetic tape.

The above-described series of processing may be executed by hardware orsoftware. If software is used, it is installed from a recording mediuminto a computer which contains special hardware integrating thecorresponding software program or into a computer, for example, ageneral-purpose computer, which executes various functions by installingvarious programs.

Such a recording medium may be formed of a package medium, as shown inFIG. 1, which is distributed to the user separately from the computer,such as a magnetic disk 18 (including a floppy disc), an optical disc 19(including compact disc read only memory (CD-ROM) and a digitalversatile disk (DVD)), a magneto-optical disk 20 (including an mini disk(MD)), or a semiconductor memory 21. The recording medium may also beformed of a ROM or a hard disk on which the program is recorded, whichcan be provided to the user while being installed in the computer.

It is not essential that the steps forming the program recorded on arecording medium be executed chronologically according to the orderdiscussed in this specification. Alternatively, they may be executedconcurrently or individually.

The term, “system”, used in this specification represents the overallapparatus formed of a plurality of devices.

1. A recording apparatus for recording an audio signal and a videosignal on an information recording medium, said recording apparatuscomprising: video packetized elementary stream packet generating meansfor generating video packetized elementary stream packets by dividing avideo elementary stream in which a video signal is compressed and codedaccording to a predetermined method by a predetermined number of videoframes and by adding a header; audio packetized elementary stream packetgenerating means for generating audio packetized elementary streampackets by dividing an audio elementary stream in which an audio signalis compressed and coded according to a predetermined method by apredetermined number of audio frames and by adding a header; videopacketized elementary stream packet unit generating means for generatinga video packetized elementary stream packet unit by combining apredetermined number of the video packetized elementary stream packets;audio packetized elementary stream packet unit generating means forgenerating an audio packetized elementary stream packet unit bycombining the audio packetized elementary stream packets correspondingto the video packetized elementary stream packet unit; sync blockgenerating means for generating sync blocks by alternately disposing thevideo packetized elementary stream packet unit and the audio packetizedelementary stream packet unit and by converting the video packetizedelementary stream packet unit and the audio packetized elementary streampacket unit into a predetermined recording format; and recording meansfor recording the sync blocks on said information recording medium;wherein said sync block generating means records a flag indicatingwhether a data area of the sync block is totally occupied with effectivedata in a header of the sync block, and, when the data area of the syncblock is not totally occupied with the effective data, a data length ofthe effective data is recorded in a head of the data area.
 2. Therecording apparatus according to claim 1, wherein the predeterminedmethod for compressing and coding the video signal and the predeterminedmethod for compressing and coding the audio signal are Moving PictureExperts Group (MPEG) methods.
 3. The recording apparatus according toclaim 1, wherein said sync block generating means generates the syncblock by recording identification information indicating the data typeof the sync block in a header of the sync block.
 4. A recording methodfor use in a recording apparatus which records an audio signal and avideo signal on an information recording medium, said recording methodcomprising the steps of: generating video packetized elementary streampackets by dividing a video elementary stream in which a video signal iscompressed and coded according to a predetermined method by apredetermined number of video frames and by adding a header; generatingaudio packetized elementary stream packets by dividing an audioelementary stream in which an audio signal is compressed and codedaccording to a predetermined method by a predetermined number of audioframes and by adding a header; generating a video packetized elementarystream packet unit by combining a predetermined number of the videopacketized elementary stream packets; generating an audio packetizedelementary stream packet unit by combining the audio packetizedelementary stream packets corresponding to the video packetizedelementary stream packet unit; generating sync blocks by alternatelydisposing the video packetized elementary stream packet unit and theaudio packetized elementary stream packet unit and by converting thevideo packetized elementary stream packet unit and the audio packetizedelementary stream packet unit into a predetermined recording format; andrecording the sync blocks on said information recording medium; whereinsaid sync block generating step records a flag indicating whether a dataarea of the sync block is totally occupied with effective data in aheader of the sync block, and, when the data area of the sync block isnot totally occupied with the effective data, a data length of theeffective data is recorded in a head of the data area.
 5. A recordingmedium for storing a computer-readable program used for recording anaudio signal and a video signal on an information recording medium, saidcomputer-readable program comprising the steps of: generating videopacketized elementary stream packets by dividing a video elementarystream in which a video signal is compressed and coded according to apredetermined method by a predetermined number of video frames and byadding a header; generating audio packetized elementary stream packetsby dividing an audio elementary stream in which an audio signal iscompressed and coded according to a predetermined method by apredetermined number of audio frames and by adding a header; generatinga video packetized elementary stream packet unit by combining apredetermined number of the video packetized elementary stream packets;generating an audio packetized elementary stream packet unit bycombining the audio packetized elementary stream packets correspondingto the video packetized elementary stream packet unit; generating syncblocks by alternately disposing the video packetized elementary streampacket unit and the audio packetized elementary stream packet unit andby converting the video packetized elementary stream packet unit and theaudio packetized elementary stream packet unit into a predeterminedrecording format; and recording the sync blocks on said informationrecording medium; wherein said sync block generating step records a flagindicating whether a data area of the sync block is totally occupiedwith effective data in a header of the sync block, and, when the dataarea of the sync block is not totally occupied with the effective data,a data length of the effective data is recorded in a head of the dataarea.